#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include<string>
#include<stack>
#include<algorithm>
using namespace std;

int main() {
    stack<char> ret;
    string s1;
    cin >> s1;
    for (auto& e : s1)
    {
        if (ret.empty() || ret.top() != e)
        {
            ret.push(e);
        }
        else {
            ret.pop();
        }
    }
    string ret1;
    while (!ret.empty())
    {
        char tmp = ret.top();
        ret.pop();
        ret1 += tmp;
    }
    reverse(ret1.begin(), ret1.end());
    cout << ret1;
    return 0;
}